import service from "@/utils/request";

export interface ILogin {
  token: string;
}

export interface IUserInfo {
  routes: string[];
  buttons: string[];
  roles: string[];
  name: string;
  avatar: string;
}
export function login(username: string, password: string) {
  return service.post<any, ILogin>("/acl/index/login", {
    username,
    password,
  });
}
export function getName() {
  return service.get<any, IUserInfo>("acl/index/info");
}

export function requestLogout() {
  return service.post<any, any>("/acl/index/logout");
}
